package com.itheima.youdianda.controller;



import com.itheima.youdianda.common.R;
import com.itheima.youdianda.entity.SysConfig;
import com.itheima.youdianda.service.SysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p >
 *
 * @author 吕永乐
 * @since 2022-05-22
 */
@RestController
@RequestMapping("/sys_config")
public class SysConfigController {
    @Autowired
    private SysConfigService iSysConfigService;

    @GetMapping("/all")
    public R all(){
        Map<String, Object> map = iSysConfigService.all();
        return R.success(map);
    }

    @PostMapping("/update")
    public R update(@RequestBody List<SysConfig> sysConfigList){
        iSysConfigService.updateBatchById(sysConfigList);
        return R.success("修改成功!");
    }
}